

#include "FileManager.h"

FileManager::FileManager(const char *inFileName)
{
	mFileName = new char[strlen(inFileName)];
	strcpy_s(mFileName,strlen(inFileName),inFileName);
}

bool FileManager::Close()
{
	if(mFile !=NULL)
	{
		if(fclose(mFile) == 0)
			return true;
		else
			return false;
	}
	return false;
}

bool FileManager::Open()
{
	if(mFile == NULL)
	{
		fopen_s(&mFile,mFileName,"r");
		if(mFile)return true;
		else return false;
	}
	return false;
}

FileManager::~FileManager()
{
	if(mFile)
	{
		fclose(mFile);
		mFile = NULL;
	}
	delete [] mFileName;
}